﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SynoManager
{
    /// <summary>
    /// Interface that defines the base functionality for each service.
    /// </summary>
    public interface IService
    {
        /// <summary>
        /// Services can throw this event if the Online State Changes
        /// </summary>
        event OnlineStateChangedEventHandler OnlineStateChanged;

        /// <summary>
        /// Gets wether the service (and device) is online.
        /// </summary>
        bool IsOnline
        { get;
        }

        /// <summary>
        /// Initialize the service.
        /// </summary>
        /// <param name="device">Device for which to initialize</param>
        void Initialize(SynoDevice device);

        /// <summary>
        /// Close the service.
        /// </summary>
        void Close();
    }

    /// <summary>
    /// Event Handler that is called in the <see cref="IService.OnlineStateChanged" /> event.
    /// </summary>
    /// <param name="sender">Object (<see cref="IService" /> that has thrown the event</param>
    /// <param name="args">Event arguments</param>
    public delegate void OnlineStateChangedEventHandler(object sender, OnlineStateChangedEventArgs args);
    /// <summary>
    /// Event Arguments for the <see cref="OnlineStateChangedEventHandler" />.
    /// </summary>
    public class OnlineStateChangedEventArgs : EventArgs
    {
        
    }
}
